import { createRouter, createWebHistory, type RouteRecordRaw } from "vue-router";
import routerData from "@/utils/dynamicRouting";
const routes: Array<RouteRecordRaw> = [
    {
        path: "/",
        name: "login",
        component: () => import("@/views/login.vue"),
        meta: {
            title: "登录",
        },
    },
    {
        path: "/home",
        name: "home",
        component: () => import("@/layout/index.vue"),
        // children: routerData as RouteRecordRaw[],
        meta: {
            title: "首页",
            icon: "Odometer",
            hidden: false,
            activeMenu: "",
            isLink: "",
            isHide: false,
            isFull: false,
            isAffix: true,
            isKeepAlive: true,
        },
    },
];
const router: any = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes: routes,
});
routerData.forEach((item: any) => {
    router.addRoute("home", item);
});
// console.log(router);
export default router;
